package com.ehome.poct.core.api.feign;

import com.ehome.core.page.PageInfo;
import com.ehome.poct.core.api.dto.PriceProfitResultDTO;
import com.ehome.poct.core.api.dto.order.PriceProfitSchemeDTO;
import com.ehome.poct.core.api.dto.order.TestStripPriceProfitSchemeDTO;
import com.ehome.poct.core.api.dto.report.PriceProfitDTO;
import com.ehome.poct.core.api.vo.order.TestStripPriceProfitSchemeVO;
import com.ehome.web.entity.ResponseWrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 检测价格方案表新增地总也需要copy一份选定的省总价格方案控制器
 *
 * @author muqiu
 * @Date 2022-06-29 14:57
 */
@FeignClient(value = "${service.poct-core:}${service.suffix.poct-core:}",path="/profitScheme",contextId = "profitScheme")
public interface TestStripPriceProfitSchemeFeignClient extends TestStripPriceProfitSchemeApi{

    @GetMapping("/page")
    PageInfo<TestStripPriceProfitSchemeVO> pageQuery(@SpringQueryMap PriceProfitSchemeDTO dto);
    @PostMapping
    TestStripPriceProfitSchemeVO addProfit(TestStripPriceProfitSchemeDTO testStripPriceProfitSchemeDTO);
    @GetMapping("/{id}")
    TestStripPriceProfitSchemeVO getById(@PathVariable("id") Long id);

    @PostMapping("/addProfit")
    ResponseWrapper<PriceProfitResultDTO> addProfit(PriceProfitDTO dto);

    @GetMapping("/info/{priceProfitSchemeId}")
    ResponseWrapper<PriceProfitDTO> getProfit(@PathVariable(value = "priceProfitSchemeId") Long priceProfitSchemeId);

    /**
     * 价格方案名称模糊查询价格方案
     * @param testStripPriceProfitSchemeDTO
     * @return
     */
    @GetMapping
    List<TestStripPriceProfitSchemeVO> list(@SpringQueryMap TestStripPriceProfitSchemeDTO testStripPriceProfitSchemeDTO);
    @PatchMapping({"/{id}"})
    void updateById(@PathVariable(value = "id") Long id,@RequestBody TestStripPriceProfitSchemeDTO setPriceProfitSchemeName);
    @GetMapping("?priceProfitSchemeName={priceProfitSchemeName}")
    List<TestStripPriceProfitSchemeDTO> list(@PathVariable("priceProfitSchemeName") String priceProfitSchemeName);
}
